package com.authine.cloudpivot.common.extension.customized.component;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.List;

/**
 * 项目正式开发时可以注释测试代码
 */
@Slf4j
@Component
public class ScheduledTest {

    @Value("#{'${cloudpivot.common.service.extension.path:aaa,bbb}'.split(',')}")
    private List<String> extensionClassPackages;

    @PostConstruct
    public void init() {
        log.info(">> init........................");
        log.info(">> @PostConstruct打印二开扩展目录 = {}", extensionClassPackages);
    }

    @PreDestroy
    public void destory() {
        log.info(">> destory........................");
    }

    @Scheduled(initialDelay = 15000, fixedDelay = 10000 * 3)
    public void testScheduled() {
//        log.info(">> 测试定时任务..@Scheduled...................");
//        log.info(">> extensionClassPackages.............. = {}", extensionClassPackages);
    }

}
